#pragma once
#include <iostream>
#include <string>
#include <functional>
#include <cstring>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <unistd.h>
#include "InetAddr.hpp"

enum code
{
    OK = 0,
    USAGE_ERR,
    SOCKET_ERR,
    BIND_ERR,
    LISTEN_ERR,
    ACCEPT_ERR,
    CONNECT_ERR,
    FORK_ERR,
    TYPE_ERR,
    OPEN_ERR,
    EPOLL_CREATE_ERR
};

class Nocopy
{
public:
    Nocopy()
    {
    }
    ~Nocopy()
    {
    }
    Nocopy(const Nocopy &s) = delete;
    const Nocopy &operator=(const Nocopy &s) = delete;
};

#define CONV(addr) (struct sockaddr *)addr